﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using KPIS.GERP.GHRMS.DAL;
using KPIS.GERP.GHRMS.IBLL;
using KPIS.GERP.GHRMS.IDAL;
using KPIS.GERP.GHRMS.DALFactory;
using KPIS.GERP.GHRMS.MODEL;

namespace KPIS.GERP.GHRMS.BLL
{
    public class MasSpecialSkillTypeBLL : IMasSpecialSkillTypeBLL
    {
        private static readonly IMasSpecialSkillTypeDAL dal = DataAccess.CreateMasterSpecialSkillTypes();

        public IList<MasSpecialSkillTypeInfo> ListSpecialSkillTypes()
        {
            return dal.ListSpecialSkillTypes(new MasSpecialSkillTypeInfo(0));
        }
        public IList<MasSpecialSkillTypeInfo> ListSpecialSkillTypes(string Sequence)
        {
            return dal.ListSpecialSkillTypes(new MasSpecialSkillTypeInfo(Sequence.Length > 0 ? Int32.Parse(Sequence) : 0));
        }
        public void Insert(string Name, string Remarks, int CreatedBy)
        {
            try
            {
                dal.Insert(new MasSpecialSkillTypeInfo(0, Name, Remarks, "", CreatedBy, 0));
            }
            catch
            {
                throw new Exception("");
            }
        }
        public void Update(int Sequence, string Name, string Remarks, int UpdatedBy)
        {
            try
            {
                dal.Update(new MasSpecialSkillTypeInfo(Sequence, Name, Remarks, "", 0, UpdatedBy));
            }
            catch
            {
                throw new Exception("");
            }
        }
        public void Delete(int Sequence, int UpdatedBy)
        {
            try
            {
                dal.Delete(Sequence, UpdatedBy);
            }
            catch
            {
                throw new Exception("");
            }
        }
    }
}
